/**
 * 权限的接口
 */
import request from "@/utils/request";

/**
 * 获取所有权限点
 */
const getPermissionList = () => request({
  url: '/sys/permission'
})

/**
 * 添加权限点
 */
const addPermission = data => request({
  url: '/sys/permission',
  method: 'POST',
  data
})

/**
 * 根据ID更新权限点详情
 */
const updatePermission = data => request({
  url: `/sys/permission/${data.id}`,
  method: 'PUT',
  data
})

/**
 * 根据id删除权限点
 */
const delPermission = id => request({
  url: `/sys/permission/${id}`,
  method: 'DELETE'
})

/**
 * 根据ID获取权限点详情
 */
const getPermissionDetail = id => request({
  url: `/sys/permission/${id}`,
})

export {
  getPermissionList,
  addPermission,
  updatePermission,
  delPermission,
  getPermissionDetail
}